package com.polaris.live.adapter.level

import com.bumptech.glide.Glide
import com.polaris.live.common.adapter.BaseBindingAdapter
import com.polaris.live.common.adapter.VBViewHolder
import com.polaris.live.databinding.AdapterMeGameLevelBinding
import com.polaris.live.resp.back_resp.UserPartyGameRule
import com.polaris.live.utils.image.ImageUtils
import com.polaris.live.R

/**
 * MeGameLevelAdapter
 *
 * @author Created by 半仙 on 2024/4/19/019 21:03
 */
class MeGameLevelAdapter : BaseBindingAdapter<AdapterMeGameLevelBinding, UserPartyGameRule>() {

    init {
        addChildClickViewIds(R.id.iv_medal)
    }

    override fun convert(holder: VBViewHolder<AdapterMeGameLevelBinding>, item: UserPartyGameRule) {
        holder.vb.apply {
            level.text = "Lv${item.level}"
            tvDiamond.text = item.score.toString()

            Glide.with(context).load(ImageUtils.imgPath(item.medal?.photoUrl)).into(ivMedal)
        }
    }

}